package com.example.database;

import android.database.Cursor;
import android.database.SQLException;


public interface IMailDAO {
    public static final String KEY_FILE_ID = "fileId";
    public static final int INDEX_FILE_ID = 0;

    public static final String KEY_TURN = "turn";
    public static final int INDEX_TURN = 1;

    public static final String KEY_FROM = "mailfrom";
    public static final int INDEX_FROM = 2;

    public static final String KEY_BODY = "body";
    public static final int INDEX_BODY = 3;

    public static final String KEY_TYPE = "type";
    public static final int INDEX_TYPE = 4;

    boolean saveMail(String fileId, Integer turn, String from, String body, String type);

    boolean deleteMail(String fileId);

    // todo remove Cursor & SQLException
    Cursor getMail(String fileId) throws SQLException;

     // todo remove Cursor
    Cursor loadAllMail();

     // todo remove SQLException
    IMailDAO open() throws SQLException;

    void close();

    Cursor loadMail(String selection, String[] args);
}
